package db;

import java.util.ArrayList;

/**
 * A year contains all data that can be assigned to a single year in a single
 * country.
 * 
 * @author markus
 * 
 */
public class Year {
	private int year;
	private int population;
	private double lifeExpMale;
	private double lifeExpFemale;
	private double sexRatioTotal;
	private double sexRatioBirth;
	private long gdp;
	private ArrayList<String> products = new ArrayList<String>();
	private ArrayList<Religion> religions = new ArrayList<Religion>();

	/**
	 * Contructor with only the year as identifier.
	 * 
	 * @param year
	 *            int
	 */
	public Year(int year) {
		this.setYear(year);
	}

	/**
	 * @param year
	 *            the year to set
	 */
	public void setYear(int year) {
		this.year = year;
	}

	/**
	 * @return the year
	 */
	public int getYear() {
		return year;
	}

	/**
	 * @param population
	 *            the population to set
	 */
	public void setPopulation(int population) {
		this.population = population;
	}

	/**
	 * @return the population
	 */
	public int getPopulation() {
		return population;
	}

	/**
	 * @param lifeExpMale
	 *            the lifeExpMale to set
	 */
	public void setLifeExpMale(double lifeExpMale) {
		this.lifeExpMale = lifeExpMale;
	}

	/**
	 * @return the lifeExpMale
	 */
	public double getLifeExpMale() {
		return lifeExpMale;
	}

	/**
	 * @param lifeExpFemale
	 *            the lifeExpFemale to set
	 */
	public void setLifeExpFemale(double lifeExpFemale) {
		this.lifeExpFemale = lifeExpFemale;
	}

	/**
	 * @return the lifeExpFemale
	 */
	public double getLifeExpFemale() {
		return lifeExpFemale;
	}

	/**
	 * @param sexRatioTotal
	 *            the sexRatioTotal to set
	 */
	public void setSexRatioTotal(double sexRatioTotal) {
		this.sexRatioTotal = sexRatioTotal;
	}

	/**
	 * @return the sexRatioTotal
	 */
	public double getSexRatioTotal() {
		return sexRatioTotal;
	}

	/**
	 * @param sexRatioBirth
	 *            the sexRatioBirth to set
	 */
	public void setSexRatioBirth(double sexRatioBirth) {
		this.sexRatioBirth = sexRatioBirth;
	}

	/**
	 * @return the sexRatioBirth
	 */
	public double getSexRatioBirth() {
		return sexRatioBirth;
	}

	/**
	 * @param gdp
	 *            the gdp to set
	 */
	public void setGdp(long gdp) {
		this.gdp = gdp;
	}

	/**
	 * @return the gdp
	 */
	public long getGdp() {
		return gdp;
	}

	/**
	 * @param products
	 *            the products to set
	 */
	public void addProduct(String name) {
		products.add(name);
	}

	/**
	 * @return the products
	 */
	public ArrayList<String> getProducts() {
		return products;
	}

	/**
	 * Add a new religion entry to the year data.
	 * @param religions the religions to set
	 */
	public void addReligion(String name, Double percent) {
		religions.add(new Religion(name, percent));
	}

	/**
	 * @return the religions
	 */
	public ArrayList<Religion> getReligions() {
		return religions;
	}

	/**
	 * Use if no percentage is given.
	 * @param name
	 */
	public void addReligionName(String name) {
		religions.add(new Religion(name));
	}
}